const path = require('path')
let packageName = require('./package.json').name
const resolve = dir => {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: './',
  lintOnSave: process.env.NODE_ENV !== 'production',
  productionSourceMap: false,
  configureWebpack: {
    output: {
      library: `${ packageName }-[name]`,
      libraryTarget: 'umd',
      jsonpFunction: `webpackJsonp_${ packageName }`
    },
    externals: {}
  },
  chainWebpack: config => {
    config.resolve.alias.set('@', resolve('src'))
  },
}
